import { FieldType } from 'choerodon-ui/pro/lib/data-set/enum';

function handleDataSetChange({ value, oldValue }: { value: Date, oldValue: Date }) {
  console.log('[range dataset newValue]', value, '[oldValue]', oldValue);
}

const spinDataSet = () => ({
  autoCreate: true,
  queryUrl: '/_api/spin',
  autoQuery: true,
  fields: [
    {
      name: 'userid',
      type: FieldType.string,
      label: '编号',
      defaultvalue: 'test',
      required: true,
    },
    {
      name: 'name',
      type: FieldType.string,
      label: '姓名',
      defaultvalue: 'gxc',
    },
  ],
  events: {
    update: handleDataSetChange,
  },
});

export default spinDataSet;